public class hk4Q2
{
    public static void main(String[] arg)
    {
        int p = 100;
        while (p < 1000)
        {
            int a = p / 100;
            int b = (p - a * 100) / 10;
            int c = p - a * 100 - b * 10;
            if (p == a * a * a + b * b * b + c * c * c)
            {
                System.out.println(p);
            }
            p++;
        }
    }
}
class TEST
{
}